<?php

use think\Facade\Route;
use think\Facade\Env;

Route::domain(Env::get('app.api_url'), function () {

    header("Access-Control-Allow-Origin: *");
    header('Access-Control-Allow-Methods: POST, PUT, GET, OPTIONS, DELETE, HEAD, PATCH');
    header("Access-Control-Allow-Headers: token,language, Origin, X-Requested-With, Content-Type, Accept");
    Route::miss(function () {
        echo '无访问权限';
        exit();
    });
    Route::group('User', function () {
        Route::post('Register', '/Register'); //用户注册
        Route::post('Login', '/Login'); //用户登录
        Route::post('Forget', '/Forget'); //忘记密码
        Route::rule('Info', '/Info'); //忘记密码
        Route::rule('ShopInfo', '/ShopInfo'); //忘记密码
        Route::get('project', '/project'); //忘记密码
        Route::rule('merchant_item', '/merchant_item'); //忘记密码
        Route::get('mymerchant', '/mymerchant'); //忘记密码
        Route::post('getmerchant', '/getmerchant'); //忘记密码

    })->prefix('User');

    Route::group('Other', function () {
        Route::post('sendMns', '/sendMns'); //用户注册
        Route::post('uploads', '/uploads'); //用户注册
    })->prefix('Other');
})->bind('api')->prefix('api');
